home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 44
/
Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso
/
-in_the_mag-
/
basics
/
blitz
/
changelibnum.lha
/
source
/
changelibnum.asc
Wrap
Text File
|
1997-11-26
|
852b
|
44 lines
;A small program to change blitz library numbers
;Do whatever you want with this source
usagetext$="Usage: Chlibnum <library name> <library number>"
;check if there were any parameters passed
pars.w=NumPars
;print usage info and exit
If pars<2 Then NPrint usagetext$:End
;find the parameters
filename$=Par$(1)
libnum.w=Val(Par$(2))
If filename$="?" Then NPrint usagetext$:End
errortext$="Can't open file "+"'"+filename$+"'"
;try to open the library
If Exists(filename$)
If OpenFile(0,filename$)
FileOutput 0
FileSeek 0,37 ;jump to the right position in the file
Print Chr$(libnum) ;print the number
DefaultOutput
CloseFile 0
Else
NPrint errortext$:End
EndIf
Else
NPrint errortext$:End
EndIf
NPrint "The new library number is "+Str$(libnum)
End